package com.ngmaster.socket;

import io.netty.channel.ChannelHandlerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 不存在的终端或者不在线的终端
 * */
public class TerminalNull<T extends ChannelHandlerContext> extends Terminal {

    private static Logger log = LoggerFactory.getLogger(TerminalNull.class);

    private static TerminalNull instance = new TerminalNull();

    public static TerminalNull getInstance() {
        return instance;
    }

    @Override
    public boolean isNull() {
        return true;
    }

    @Override
    public boolean sendMessage(ProtocolMessage message) {
        log.info("[device is not found or not online.] [message:{}]", message);
        return false;
    }
}
